<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>收集表单数据</title>
    <!-- 引用开发版 -->
    <!-- <script type="text/javascript" src="../js/vue.js"></script> -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <!--
    
     -->
    <!-- 准备一个容器 -->
    <div id="root">
        <form>
            输入框：<input type="text" v-model="key"> <br/><br/>
            <button @click="move">提交</button>
            
        </form>
    </div>

    <script type="text/javascript">
        Vue.config.productionTip = false
        const vm = new Vue({
            el: '#root',
            data () {
                return {
                    key:''
                }
            },
            methods: {
                move() {
                    let searchKey = encodeURI(this.key.trim())
                    let link = 'https://www.baidu.com/s?&wd=' + searchKey + '&p=3&cb=handleSuggestion'
                    window.open(link,'_blank')
                }
            }
        })
    </script>
</body>

</html>